<!--  tambah kelas modal -->
<div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Tambah Pendamping</h4>
      </div>
      <div class="modal-body">
        <?php 
            echo form_open_multipart('bagi_pendamping/add_exe', array('class' => 'form-horizontal', 'role' => 'form')); 
        ?>
        <input type="hidden" name="id_atur_kelas" value="<?php echo $nis = $this->security->xss_clean($this->uri->segment(3));?>"/>                   
        
        <div class="form-group">
            <label class="col-sm-3 control-label label-elba">Pendamping</label>
            <div class="col-sm-5">
                <select name="id_mr_pegawai" class="form-control form-elba input-sm">
                    <?php 
                        if(count($list_pegawai)>0){
                            foreach ($list_pegawai as $row_p){ 
                    ?>
                        <option value="<?php echo $row_p->id_mr_pegawai; ?>"><?php echo $row_p->nm_pegawai; ?></option>
                    <?php 
                            }
                        }else{
                    ?>
                        <option value="null">Belum ada data Wali Kelas</option>
                    <?php
                        }
                    ?>
                </select>
            </div>
        </div>
        
        <div class="modal-footer">
            <button type="submit" class="btn btn-default btn-sm" data-dismiss="modal">Batal</button>
            <button type="submit" class="btn btn-primary btn-sm">Tambahkan</button>
         </div>
    
        <?php 
            echo form_close();
        ?>
      </div>      
    </div>
  </div>
</div>
<!-- end tambah kelas modal -->
<div id="page-wrapper">
    <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <span class="judul-page">Pendamping</span>
                    <span class="pull-right">
                        <a href="<?php echo site_url(); ?>atur_kelas/detail/<?php echo "".$id_atur_kelas->id_mr_th_ajaran."/".$id_atur_kelas->id_lembaga; ?>" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-arrow-left"></span>&nbsp;Kembali</a>
                        <a href="" class="btn btn-warning btn-xs" data-toggle="modal" data-target="#AddModal"><span class="glyphicon glyphicon-plus"></span>&nbsp;Tambah Pendamping</a>
                    </span>
                    <div class="clearfix"></div>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                      <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th width="50">#</th>
                                <th>Pendamping</th>
                            </tr>
                        </thead>
                        <tbody>
						<?php 
							if(count($list)>0){
								$i = 1; 
								foreach ($list as $row) {
						?>									
                            <tr class="kursor">
                                <td><?php echo $i++ ?></td>
                                <td><?php echo $row->nm_pegawai; ?> <a href="<?php echo site_url('bagi_pendamping/delete/'.$row->id_mr_pendamping);?>" onclick="return confirm('Yakin Anda akan menghapus data Pendamping ini secara permanen?')" class="btn btn-danger btn-xs pull-right" title="Hapus"><span class="glyphicon glyphicon-trash"></span></a></td> 
                            </tr>
						<?php
								}
							}else{
						?>
							<tr>
                                <td colspan="2"><center>Belum ada data pendamping</center></td>
							</tr>
						<?php
							}
						?>
                        </tbody>
                      </table>
                    </div>
                    <div class="clearfix"></div>
                    <center>
                    <?php
                    echo ! empty($pagination) ? '<center><div class="pagination">' . $pagination . '</div></center>' : '';
                    ?>
                    </center>
                </div>
            </div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->
<script>
$("tr").click(function() {
  window.location.href = $(this).find("a").attr("href");
});
</script>